﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;

namespace Shop.Presenter
{
    public class MainPresenter
    {
        private Shop.IView _mainView;
        private ShopContext _context;
        public MainPresenter(IView view, ShopContext context)
        {
            _mainView = view;
            _context = context;
            _mainView.SelectCategories += _mainView_SelectCategories;
            _mainView.SelectProduct += _mainView_SelectProduct;
        }

        void _mainView_SelectProduct()
        {
            throw new NotImplementedException();
        }

        void _mainView_SelectCategories()
        {
            throw new NotImplementedException();
        }

        private IReadOnlyCollection<string> GetAllCategories()
        {
            List<string> categoryList = new List<string>();
            foreach (var item in _context.ProductCategories)
            {
                categoryList.Add(item.Name);
            }
            return categoryList;
        }
        //private IReadOnlyCollection<string>
        public void Run()
        {
            //_mainView.Тутдолженбытьметодкоторыйустанавливаетзначениякатегорий(getCategories);
            this._mainView.Show();
        }


    }
}
